package com.share.finance.risk.core.init;

import com.share.finance.risk.core.service.IProductVariateService;
import com.share.finance.risk.core.service.IVariateConfService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Slf4j
@Component
public class ProductVariateInit {
    @Autowired
    private IProductVariateService iProductVariateService;

    @Autowired
    private IVariateConfService iVariateConfService;

    @PostConstruct
    @Scheduled(cron = "0 0/7 * * * ?")
    public void initProductVariate() {
        log.info("---正在初始化iVariateConfService---");
        iVariateConfService.init();  //


        log.info("---正在初始化iProductVariateService---");
        iProductVariateService.init();
    }
}
